package ${config.packageMapper};

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import ${config.packageEntity}.${tableInfo.javaName}${config.suffixEntity};

/**
 * ${tableInfo.dbName}表Mapper类<#if tableInfo.comment?? && (tableInfo.comment?length>0)>, ${tableInfo.comment}</#if>
 *
 * @author ${config.author}
 * @date ${.now?string("yyyy-MM-dd HH:mm:ss")}
 */
@Mapper
public interface ${tableInfo.javaName}${config.suffixMapper} {
    /**
     * 列表查询
     *
     * @param ${utils.getLowerFirst(tableInfo.javaName)}
     * @return
     */
    List<${tableInfo.javaName}${config.suffixEntity}> selectList(${tableInfo.javaName}${config.suffixEntity} ${utils.getLowerFirst(tableInfo.javaName)});

<#if tableInfo.primaryKey??>
    /**
     * 主键查询
     *
<#list tableInfo.primaryKeyColumns as col>
     * @param ${col.javaName}
</#list>
     * @return
     */
    ${tableInfo.javaName}${config.suffixEntity} getBy${utils.getUpperCamel(tableInfo.primaryKey)}(<#list tableInfo.primaryKeyColumns as col>@Param("${col.javaName}") ${utils.getSimpleTypeName(col.javaType)} ${col.javaName}<#if col?has_next>, </#if></#list>);
</#if>

    /**
     * 新增记录
     *
     * @param ${utils.getLowerFirst(tableInfo.javaName)}
     * @return
     */
    Integer insert(${tableInfo.javaName}${config.suffixEntity} ${utils.getLowerFirst(tableInfo.javaName)});

    /**
     * 更新记录
     *
     * @param ${utils.getLowerFirst(tableInfo.javaName)}
     * @return
     */
    Integer update(${tableInfo.javaName}${config.suffixEntity} ${utils.getLowerFirst(tableInfo.javaName)});
}